package ex401.shape;

public class CircleComponent extends Component {
    private double radius;

    public CircleComponent(Character type, Double radius) {
        super(type);
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI * radius * radius;
    }

    @Override
    public String toString() {
        return "CircleComponent[" + getType() + "," + radius + "]";
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }
}
